package com.software.form.inquiry.sagent.dao;

import java.util.ArrayList;
import java.util.List;

public class InquirySagentTransaction {

	private InquirySagentDao inquirySagentDao;

	public InquirySagentDao getInquirySagentDao() {
		return inquirySagentDao;
	}

	public void setInquirySagentDao(InquirySagentDao inquirySagentDao) {
		this.inquirySagentDao = inquirySagentDao;
	}
	
	public List<String> getInquiriesByEmail(String email,int status){
		List<InquirySagent> list = inquirySagentDao.queryNoBySagentEmail(email,status);
		if(list.size() > 0){
			List<String> inos = new ArrayList<String>();
			for(int i=0; i < list.size(); i++)
				inos.add(list.get(i).getIno());
			return inos;
		}else{
			return null;
		}
	}
	
	public boolean updateStatusToDisable(String ino, String email,int status){
		return inquirySagentDao.updateStatus(ino, email, status);
	}
	
	public boolean add(String ino,String agentEmail,int status){
		return inquirySagentDao.add(ino, agentEmail, status);
	}
}
